package com.bean.dao;

import com.bean.pojo.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Repository;

@Repository
public class UserDaoImpl implements UserDao {
    @Override
    public void save() {
//获取User的bean
        ApplicationContext context = new ClassPathXmlApplicationContext("spring-config.xml");
        User user = context.getBean( User.class);
        System.out.println(user);
        System.out.println("执行了UserDaoImpl的save方法");
    }
}
